<?php

/**
 * item_action_field form base class.
 *
 * @method item_action_field getObject() Returns the current form's model object
 *
 * @package    forumCDE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class Baseitem_action_fieldForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'owner_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('actionwf'), 'add_empty' => true)),
      'fieldname'        => new sfWidgetFormInputText(),
      'detail'           => new sfWidgetFormInputCheckbox(),
      'caption'          => new sfWidgetFormInputText(),
      'helptext'         => new sfWidgetFormInputText(),
      'notnull'          => new sfWidgetFormInputCheckbox(),
      'readonly'         => new sfWidgetFormInputCheckbox(),
      'xdefault'         => new sfWidgetFormInputText(),
      'onlyblank'        => new sfWidgetFormInputCheckbox(),
      'filter'           => new sfWidgetFormInputText(),
      'categorie_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('categorie'), 'add_empty' => true)),
      'htmlattributes'   => new sfWidgetFormTextarea(),
      'onchangefunction' => new sfWidgetFormInputText(),
      'script'           => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'owner_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('actionwf'), 'required' => false)),
      'fieldname'        => new sfValidatorString(array('max_length' => 255)),
      'detail'           => new sfValidatorBoolean(array('required' => false)),
      'caption'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'helptext'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'notnull'          => new sfValidatorBoolean(array('required' => false)),
      'readonly'         => new sfValidatorBoolean(array('required' => false)),
      'xdefault'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'onlyblank'        => new sfValidatorBoolean(array('required' => false)),
      'filter'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'categorie_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('categorie'), 'required' => false)),
      'htmlattributes'   => new sfValidatorString(array('required' => false)),
      'onchangefunction' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'script'           => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('item_action_field[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'item_action_field';
  }

}
